package com.ycyoes.test.hollis.concurrent.factory.factorymethod;

import com.ycyoes.test.hollis.concurrent.factory.simplefactory.*;

public class OperationFactory {
    //工厂接口
    public interface IFactory {
        Operation CreateOption();
    }

    //加法类工厂
    public static class AddFactory implements IFactory {
        public Operation CreateOption() {
            return new OperationAdd();
        }
    }

    //除法类工厂
    public class DivFactory implements IFactory {
        public Operation CreateOption() {
            return new OperationDiv();
        }
    }

    //乘法类工厂
    public class MulFactory implements IFactory {
        public Operation CreateOption() {
            return new OperationMul();
        }
    }

    //减法类工厂
    public class SubFactory implements IFactory {
        public Operation CreateOption() {
            return new OperationSub();
        }
    }
}
